﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Admin.Master" Inherits="System.Web.Mvc.ViewPage<DrugStore.Models.ManageNewModel>" %>

<asp:Content ID="Content2" ContentPlaceHolderID="TitleContent" runat="server">
Chỉnh sửa tin tức
</asp:Content>

<asp:Content ID="Content1" ContentPlaceHolderID="main" runat="server">
<h2>Chỉnh sửa tin tức</h2>
   <span style="color:Green"><%: ViewData["Message"] %></span>
   <form method="post" action="" enctype="multipart/form-data">
        <%: Html.ValidationSummary(true) %>
        <table class="formStyle1" width="95%">
            <tr>
                <td colspan="2" valign="top" align="center">
                    <img src="<%: Model.ImagePath %>" style="max-width: 250px" title="<%: Model.Title %>" alt="<%: Model.Title %>" />
                </td>
            </tr>
            <tr>
                <td width="100px;" valign="top"><%: Html.LabelFor(model => model.Title) %></td>
                <td>
                    <%: Html.TextBoxFor(model => model.Title, new {style="width:250px"})%> * 
                    <%: Html.ValidationMessageFor(model => model.Title) %>
                </td>
            </tr>   
            <tr>
               <td><%: Html.LabelFor(model => model.ImagePath) %></td>
               <td>
                     <input type="file" name="imgPath" accept="image/png,image/jpeg,image/gif"/>
               </td>
            </tr>
            <tr>
               <td><%: Html.LabelFor(mode => mode.Content)%></td>
               <td>
                    <%:Html.TextAreaFor(model => model.Content, new { col = 50,row = 6})%>
                    <%: Html.ValidationMessageFor(model => model.Content) %>
                </td>
            </tr>
            <tr>
                <td width="100px;" valign="top"><%: Html.LabelFor(model => model.SelectedCategories) %></td>
                <td>
                   <% foreach (DrugStore.Models.Category c in Model.Categories)
                      { %>
                        <span  class="news-category"><input type="checkbox" name="SelectedCategories" value="<%: c.CategoryId %>" id="<%: c.CategoryId %>"
                         <% foreach (String s in Model.SelectedCategories)
                           {
                               if (c.CategoryId.ToString().Equals(s, StringComparison.OrdinalIgnoreCase))
                               {%>
                                checked="checked"
                        <%}
                           } %>/>
                           <label for="<%: c.CategoryId %>"><%: c.Name %></label>
                           </span>
                   <% } %>
                </td>
            </tr>
            <tr>
                <td></td>
                <td>
                    <input width="50px" type="submit" value="     Tạo Mới    " />
                </td>
            </tr>
        </table>
   </form>
    <script type="text/javascript">
        CKEDITOR.replace('Content', {
            fullPage: true,
            extraPlugins: 'docprops'
        });     
    </script>
</asp:Content>